package com.boat.sample.support.interfaces.controller;

import org.springframework.web.bind.annotation.RestController;

import com.boat.boat.support.api.controller.AccountApi;
import com.boat.boat.support.api.dto.account.AccountInfoRsp;
import com.boat.boat.support.api.dto.account.OpenAccountReq;
import com.boat.boat.support.api.dto.account.OpenAccountRsp;
import com.boat.framework.base.api.Response;

import lombok.extern.slf4j.Slf4j;

/**
 * 账户服务实现类
 * 
 * @author 周江
 *
 */
@Slf4j
@RestController
public class AccountController implements AccountApi {

	@Override
	public Response<AccountInfoRsp> accountInfo(Integer userId) {
		AccountInfoRsp rsp = new AccountInfoRsp();
		rsp.setUserId(userId);
		rsp.setName("zj");
		return Response.ok(rsp);
	}

	@Override
	public Response<OpenAccountRsp> openAccount(OpenAccountReq request) {
		OpenAccountRsp rsp = new OpenAccountRsp();
		rsp.setUserId(request.getUserId());
		rsp.setName(request.getName());
		rsp.setResult(true);
		return Response.ok(rsp);
	}

}
